/*
 * @Author: hucc
 * @Date: 2021-09-27 09:29:06
 * @LastEditors: hucc
 * @LastEditTime: 2021-09-27 09:41:41
 * @Description: 
 */
//ES5普通函数
let arr = ['tom', 'terry', 'jacky']
let result1 = arr.filter(function(item) {
    return item == 'tom';
})
console.log(result1); //[ 'tom' ]
//ES6箭头函数
let result2 = arr.filter((item) => {
    return item == 'tom';
})
console.log(result2); //[ 'tom' ]
//箭头函数极简形式 要求：只有一个形参，有且只有一条函数语句
let result3 = arr.filter(item => item == 'tom')
console.log(result3);

//let myFun=function(){}  等价于let myFun=()=>{}